import express from 'express'

import getApi from '../api/demos/getApi';
import postApi from '../api/demos/postApi';

import gp_101fuseface_postApi from '../api/gp_101fuseface/gp-101fuseface-postApi';
import gp_101fuseface_postApi_2 from '../api/gp_101fuseface/gp_101fuseface_postApi_2';

import women2020_postApi from '../api/women2020/women2020_postApi';

import school_wechat_web_postApi from '../api/school-wechat-web/school_wechat_web_postApi';

import file_export_and_import_postApi from '../api/file-export-and-import/file-export-and-import-postApi';

import cloud_authorization_postApi from '../api/cloud-authorization/cloud_authorization_postApi';
import cloud_authorization_getApi from '../api/cloud-authorization/cloud_authorization_getApi';

import sanning_vue_postApi from '../api/sanning_vue/sanning_vue_postApi';
import sanning_vue_getApi from '../api/sanning_vue/sanning_vue_getApi';
import sanning_vue_putApi from '../api/sanning_vue/sanning_vue_putApi';
import sanning_vue_deleteApi from '../api/sanning_vue/sanning_vue_deleteApi';

import user_post from '../api/yw-user/user_postApi';
import user_get from '../api/yw-user/user_getApi';

const router = express.Router()

// sanning_vue
for (let k in sanning_vue_postApi) {
  router.post(`/sanning_vue/${k}`, function (req, res) {
    res.json(sanning_vue_postApi[k])
  })
}
for (let k in sanning_vue_putApi) {
  router.put(`/sanning_vue/${k}/*`, function (req, res) {
    res.json(sanning_vue_putApi[k])
  })
}
for (let k in sanning_vue_deleteApi) {
  router.delete(`/sanning_vue/${k}`, function (req, res) {
    res.json(sanning_vue_deleteApi[k])
  })
}
for (let k in sanning_vue_getApi) {
  router.get(`/sanning_vue/${k}`, function (req, res) {
    res.json(sanning_vue_getApi[k])
  })
}

// cloud-authorization
for (let k in cloud_authorization_postApi) {
  router.post(`/cloud-authorization/${k}`, function (req, res) {
    res.json(cloud_authorization_postApi[k])
  })
}
for (let k in cloud_authorization_getApi) {
  router.get(`/cloud-authorization/${k}`, function (req, res) {
    res.json(cloud_authorization_getApi[k])
  })
}

// file-export-and-import
for (let k in file_export_and_import_postApi) {
  router.post(`/postUrl/file-export-and-import/${k}`, function (req, res) {
    res.json(file_export_and_import_postApi[k])
  })
}

// school-wechat-web
for (let k in school_wechat_web_postApi) {
  router.post(`/postUrl/school-wechat-web/${k}`, function (req, res) {
    res.json(school_wechat_web_postApi[k])
  })
}

// gp_101fuseface
for (let k in gp_101fuseface_postApi) {
  router.post(`/postUrl/gp_101fuseface/${k}`, function (req, res) {
    res.json(gp_101fuseface_postApi[k])
  })
}
for (let k in gp_101fuseface_postApi_2) {
  router.post(`/postUrl/gp_101fuseface/${k}`, function (req, res) {
    res.json(gp_101fuseface_postApi_2[k])
  })
}

// women2020
for (let k in women2020_postApi) {
  router.post(`/postUrl/women2020/${k}`, function (req, res) {
    res.json(women2020_postApi[k])
  })
}

// demos
for (let k in getApi) {
  router.get(`/getUrl/demos/${k}`, function (req, res) {
    res.json(getApi[k])
  })
}
for (let k in postApi) {
  router.post(`/postUrl/demos/${k}`, function (req, res) {
    res.json(postApi[k])
  })
}

// yw-user
for (let k in user_post) {
  router.post(`/user/${k}`, function (req, res) {
    res.json(user_post[k])
  })
}
for (let k in user_get) {
  router.get(`/user/${k}`, function (req, res) {
    res.json(user_get[k])
  })
}

export default router